<style type="text/css">
body{background:#eee}
.storelogo img{width:3.2rem;height:3.2rem}
.merchgroup .store-star {padding:0.1rem 0 0.2rem 0;font-size:0.55rem;line-height:1rem}
.merchgroup .store-star img{height:0.66rem}
.star-on,.star-off{position:absolute;top:1rem;left:0;overflow:hidden}
.star-rate {margin-left:3.6rem}
.store-distance{float:right;color:#999}
.store-moneylimit{font-size:0.55rem}
.weui_cell_hd {
    padding: 0.6rem;
	padding-left: 0;
}
</style>
<div class="fui-page order-create-page fui-page-current" ng-if="pagedata.op == 'main'">
	 <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">确认订单</div>
		<div class="fui-header-right"></div>
	</div>
	<div class="fui-content">
	<div style="padding:0.5rem;">
		<div class="fui-cell-group" style="margin-top:0">
			<div class="fui-cell">
					<div class="fui-cell-info" style="line-height:1.6">
						<div class="bold"><img src="{{tomedia(pagedata.activity.image) || '../core/resource/images/nopic.jpg'}}" style="width: 1.3rem; height: 1.3rem;"> {{pagedata.activity.title}}</div>
						<div class="gray" style="padding:0 0.3rem;font-size:0.65rem">
						<div>活动地址：<span>{{pagedata.activity.address}}</span> <i class="icon icon-ditu"></i></div>
						<div ng-if="pagedata.activity.organize">活动发起方：<span>{{pagedata.activity.organize}}</span></div>
						<div>活动开始时间：<span>{{pagedata.activity.time || '待定'}}</span></div>
						<div>报名截止时间：<span>{{pagedata.activity.end}}</span></div>
						<div ng-if="pagedata.activity.money>0">报名费用：<span class="red">{{pagedata.activity.money}}元/人</span></div>
						</div>
					</div>
			</div>
		</div>
		<div style="margin-top:0.5rem;padding-bottom:2rem">
			<div class="fui-cell-group" ng-repeat="member in pagedata.post.members track by $index" style="margin-top:0">
			<div class="fui-cell">
					<div class="fui-cell-label bold" style="padding-right:0">
						报名人{{$index+1}}.
					</div>
					<div class="fui-cell-info"></div>
					<div ng-if="$index>0" class="fui-cell-remark noremark" ng-click="pagedata.post.members.splice($index,1);pagedata.upmoney();" style="padding-right:0">
						<i class="icon icon-jian bold red"></i>
					</div>
			</div>
			<div ng-include="sys_html('_diyform_more')"></div>
			</div>
			<div class="c bold" style="padding:0.5rem" ng-click="pagedata.adddiy();">
				<div style="font-size:0.7rem;">+增加报名人</div>
			</div>
		</div>
	</div>
	</div>
	<div class="fui-navbar-tip c" style="color:#999;background:#f2f2f2;height:1.8rem;bottom:2.55rem">
		<div class="fui-cellone sm" style="padding:0">
			<div class="fui-cellone-info" style='line-height:1.4;font-size:0.7rem'>
				<span class="text"><input type="checkbox" ng-checked="pagedata.post.checked==true" ng-model="pagedata.post.checked" name="checkbox" class="fui-radio fui-radio-danger cartmode check-item"/></span>
				<span class="text" ng-click="pagedata.show_xieyi=true;">{{pagedata.activity.organize || pagedata.account.title}} | <a style="color:#337ab7;">《报名注意事项》</a></span>
			</div>
		</div>
	</div>
	<div ng-if="pagedata.post.money>0" class="fui-navbar order-create-checkout">
		<a href="javascript:;" class="nav-item total" style="text-align:left;padding-left:0.5rem">
			<span  class="text-danger bigprice">&yen; 
				<span class="totalprice" style="font-size:1.2rem">{{price(pagedata.post.money) || '0.00'}}</span>
			</span>
		</a>
		<a href="javascript:;" class="nav-item btn btn-danger buybtn" ng-if="!pagedata.order_id" ng-click="pagedata.pay_submit(pagedata.post,'jy_mbaoming/book/notice/','jy_mbaoming/order//status=2')" >
			<div class="fee-tagup-nav">
				确认支付
			</div>
		</a>
		<a href="javascript:;" class="nav-item btn btn-danger buybtn" ng-if="pagedata.order_id" ng-click="access_json('jy_mbaoming/order/')" >
			<div class="fee-tag-nav">
				查看订单
			</div>
		</a>
	</div>
	<div ng-if="pagedata.post.money==0" class="fui-navbar order-create-checkout">
		<a href="javascript:;" class="nav-item btn btn-danger buybtn" ng-click="post(pagedata.post,'jy_mbaoming/book/notice/')" >
			<div class="fee-tagup-nav">
				确认报名
			</div>
		</a>
	</div>
	<div ng-if="pagedata.show_xieyi" class="popup">
		<div class="popup-body">
			<div class="popup-center">
				<i class="closed icon icon-cuowu" ng-click="pagedata.show_xieyi=false"></i>
				<div class="content-images" style="padding:0.5rem;height:20rem; overflow-y:scroll;">
						<div class="title bold" style="font-size:0.8rem">报名注意事项 / <small>Read Ggree</small></div>
						<div class="text" style="padding-top:0.5rem;font-size:0.7rem" ng-bind-html="trust(pagedata.xieyi.content)">
						</div>
				</div>
				<div ng-if="pagedata.show_type!=2" class="modal-footer">
					<div ng-click="pagedata.show_xieyi=false;pagedata.post.check=1;" class="mod-check" style="width: 100%; margin: 0;">我已阅读</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
scope.pagedata.pay_submit=function(post,post_url,complete_url){
	scope.post_json(post_url,post,function(result){
		if(result.order_id){
			scope.pagedata.order_id=result.order_id;
			scope.$evalAsync();
			scope.tool.pay(result.pay_id,function(res){
					if(res.type=='success'){
						scope.message('支付成功！','success',complete_url);
					}else{
						scope.message('支付失败！','success',complete_url);
					}
			},'','',complete_url,complete_url);
		}
	});
}
scope.pagedata.getprovince=function(){
	scope.get('core/member.set/getprovince/',function(res){
		scope.pagedata.extradata.province=res.province;
		scope.$evalAsync();
	});
}
scope.pagedata.getprovince();
scope.pagedata.adddiy=function(){
	scope.pagedata.adddiydata.key=scope.pagedata.post.members.length;
	let str=JSON.parse(JSON.stringify(scope.pagedata.adddiydata))
	scope.pagedata.post.members[scope.pagedata.post.members.length]=str;
	scope.pagedata.upmoney();
	scope.$evalAsync();
}
scope.pagedata.upmoney=function(){
	scope.pagedata.post.money=scope.pagedata.activity.money*scope.pagedata.post.members.length;
	scope.$evalAsync();
}
</script>